<template>
	<view class="">
		<u-form label-position="left" v-model="uform" ref="uform" :rules="rules"   :error-type="erroryType">
			<u-form-item  :border-bottom="false" prop="money">
				<view class="top fill">
					<view class="linH top-t">提现金额：</view>
					<view class="linH input-con row"><input type="digit" value="" placeholder="请输入提现金额" v-model="uform.money" class="input" confirm-type="done" /></view>
					<!-- <view class="b-t top-b linH">本次提现收取手续费：0.6%，实际到账：￥0.00</view> -->
					<view class="b-t top-b linH" @tap="getAll">全部提现</view>
				</view>
			</u-form-item>
			<view class="top" style="padding:20upx;">
				<view class="row">
					<image src="/static/img/wx.png" mode="" class="w-icon"></image>
					<text class="w-title">提现到微信</text>
				</view>
			</view>
		</u-form>

		<view class="btn" hover-class="hover-opacity" @tap="subFrom">提交审核</view>
		<mix-loading v-if="isLoading"></mix-loading>
	</view>
</template>

<script>
export default {
	data() {
		return {
			erroryType: ["toast"],
			uform: {
				money:""
			},
			money:"",
			rules: {
				money: [{required: true, message: "请输入提现金额"}]
			}
		};
	},
	onLoad(options) {
		this.money=options.money;
	},
	methods: {
		getAll(){
			this.uform.money=this.money;
		},
		subFrom() {
			this.$refs.uform.validate(async valid => {
				if (valid) {
					const data={
						uid:uni.getStorageSync('uid'),
						money:this.uform.money
					}
					const res=await this.$request('tz/withdraw',data,{showLoading:true});
					if(res.result==0){
						this.$util.msg('提交成功!请耐心等待平台审核!');
						this.$util.prePage().commission=this.money-this.uform.money;
						this.back();
					}else{
						this.$util.msg(res.resultNote);
					}
				}
			});
		}
	}
};
</script>
<style>
page {
	background: #f6f6f6;
}
</style>
<style scoped>
.linH {
	line-height: 100upx;
	padding: 0 20upx;
}
.top {
	background: #ffffff;
}
.top-b {
	font-size: 22upx;
	font-family: PingFang SC;
	font-weight: 500;
	color:#CB5053;
}
.top-t {
	font-size: 22upx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #333333;
}
.input {
	width: 100%;
	line-height: 100upx;
	height: 100upx;
}
.input-con::before {
	content: "￥";
	font-size: 48upx;
	font-family: SourceHanSansCN;
	font-weight: 400;
	color: #333333;
}
.finput {
	text-align: right;
}
.btn {
	width: 700upx;
	height: 88upx;
	line-height: 88upx;
	background: #bec3cf;
	border-radius: 44upx;
	font-size: 28upx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #ffffff;
	text-align: center;
	margin: 100upx auto;
}
.w-icon{
	width: 80upx;
	height: 80upx;
	margin-right: 20upx;
}
.w-title{
	font-size: 28upx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #000000;
}
</style>
